import React , { Component,Suspense, lazy  } from 'react';
import { withRouter,NavLink,Switch,Redirect,Route} from 'react-router-dom';

const Home = lazy(() => import('./views/Home'));
const Action = lazy(() => import('./views/action'));
const First = lazy(() => import('./views/First'));
const TwoRedux = lazy(() => import('./views/TwoRedux'));
const AjaxPage = lazy(() => import('./views/AjaxPage'));
const AjaxPage1 = lazy(() => import('./views/AjaxPage/index2.jsx'));


const Downup = lazy(() => import('./views/Downup'));
const Jl = lazy(() => import('./views/Jl'));
// const Exam = lazy(() => import('./views/Exam'));


class App extends Component {
    render(){
        return (
            <Suspense fallback={<div>Loading...</div>}>
                <Switch>
                    <Route exact path="/" component={Home} />
                    <Route path="/action" component={Action} />
                    <Route path="/first" component={First} />
                    <Route path="/tworedux" component={TwoRedux} />
                    <Route path="/ajaxpage" component={AjaxPage} />
                    <Route path="/ajaxpage1" component={AjaxPage1} />
                    <Route path="/downup" component={Downup} />
                    <Route path="/jl" component={Jl} />
                    <Redirect to="/"/>
                </Switch>
            </Suspense>
        );
    }
}
export default App;
